	function hechen(){ 
	//获取时间 
	var mydate = new Date(); 
	//var date=mydate.toLocaleString('chinese', { hour12: false });//时间格式24小时制
	var date = mydate.getFullYear()+'-'+(mydate.getMonth()+1)+'-'+mydate.getDate()+' '+mydate.getHours()+':'+mydate.getMinutes();

	//获取画布对象 
	var mainCtx = getCanvasContext('main'); 
	var maxWidth = mainCtx.width; 
	var maxHeight = mainCtx.height; mainCtx.clearRect(0,0,1000,1000);

	//获取图片的实际路径 
	var starImg = new Image(); 
	starImg.src='images/img2.png'; 
		
	//合成 
	starImg.onload=function(){ 
	//先把图片绘制在这里 
mainCtx.drawImage(starImg,0,0,750,1200); 
		//设置文本的大小字体等属性 
		mainCtx.font = "small-caps 22px Arial"; 
		//设置文本填充颜色 
		mainCtx.fillStyle = "white"; 
		//绘制文字 
		mainCtx.textAlign = "center";
		mainCtx.fillText($('.text1').val(),365,380);
		mainCtx.fillText($('.text2').val(),365,405);
		mainCtx.fillText($('.text3').val(),365,435);
		mainCtx.fillText($('.text4').val(),365,505);
		//设置文本填充颜色
		mainCtx.fillStyle = "black";
		mainCtx.fillText($('.text5').val(),365,540);
		//设置时间文本的大小字体属性 
		mainCtx.font = "small-caps 17px Arial"; 
		//绘制时间 
		mainCtx.fillStyle = "white";
		mainCtx.fillText(date,640,690);
	    //}
		var myCanvas = document.getElementById("main"); 
		var image = myCanvas.toDataURL("image/png");
		document.getElementById("bodycn").innerHTML = "<div class='weui-grids'  id='draw'><img src='"+image+"' class='imgs'></div><div class='tips'><span>Tip:长按结果解释保存图片</span><span><a href='https://room202.gitee.io/'>重玩一次</a></span></div>";
		}; 

		} 
	//通过id获取canvas对象 
	function getCanvasContext(id){ 
		return document.getElementById(id).getContext("2d"); 
		}  

   //下载图片 
//   function saveAsLocalImage(){ 
//	   var myCanvas = document.getElementById("main"); 
//	   var alink = document.getElementById("sss");
//	   var image = myCanvas.toDataURL("image/png"); 
//	    alink.href=image;
//	    alink.download = "小黑屋快乐.png";  
//        alink.click(); 
//	   } 